@extends('layouts.goods')
@section('content')
<body class="pos-r">

<!-- <div class="pos-a" style="width:200px;left:0;top:0; bottom:0; height:100%; border-right:1px solid #e5e5e5; background-color:#f5f5f5; overflow:auto;">
	<ul id="treeDemo" class="ztree"></ul>
</div> -->
<div style="arigmn-left:0px;">
	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 产品管理 <span class="c-gray en">&gt;</span> 产品列表 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
	<div class="page-container">
		<div class="text-c">
			<form action="/admin/goods" >
				<input type="text" name="name" id="" placeholder="{{$name}}" style="width:250px" class="input-text">
				<button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i> 搜产品</button>
			</form>
		</div>
		<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a class="btn btn-primary radius" onclick="product_add('添加产品','product-add.html')" href="/admin/goods/create"><i class="Hui-iconfont">&#xe600;</i> 添加产品</a></span><span class="r">共有数据：<strong>{{$num}}</strong> 条</span> </div>
		<div class="mt-20">
			<table class="table table-border table-bordered table-bg table-hover table-sort">
				<thead>
					<tr class="text-c">
						<th width="40"><input name="" type="checkbox" value=""></th>
						<th width="40">ID</th>
						<th width="60">缩略图</th>
						<th width="150">产品名称</th>
						<th width="100">所属店铺</th>
						<th width="40">库存</th>
						<th width="40">销量</th>
						<th width="100">单价</th>
						<th width="60">发布状态</th>
						<th width="60">操作</th>
					</tr>
				</thead>
				<tbody>
					@foreach($goods as $good)
					<tr class="text-c va-m">
						<td><input name="" type="checkbox" value=""></td>
						<td>{{$good->goods_id}}</td>
						<td><img width="60" class="product-thumb" src="/upload/images/{{$good->pic}}"></td>
						<td class="text-l"><a style="text-decoration:none" href="/goods/{{$good->goods_id}}"><b class="text-success">{{$good->goods_name}}</b></td>
						<td class="text-l">{{$good->store_name}}</td>
						<td class="text-l">{{$good->number}}</td>
						<td class="text-l">{{$good->sold_number}}</td>
						<td><span class="price">{{$good->shop_price}}</td>
						<td class="td-status"> <?php  echo ($good->status ? "<span class='label label-success radius'>上架</span>" : "<span class='label label-danger radius'>下架</span>");?></td>
						<td class="td-manage">
							<a style="text-decoration:none" href="/admin/goods/status/{{$good->goods_id}}"><i class="Hui-iconfont"><?php  echo ($good->status ? '下架' : '上架');?> |</i></a> 
							<a style="text-decoration:none" class="ml-5" href="/admin/goods/{{$good->goods_id}}/edit" ><i class="Hui-iconfont">编辑 |</i></a> 
							<a style="text-decoration:none" class="ml-5" href="/admin/goods/del/{{$good->goods_id}}" ><i class="Hui-iconfont">删除</i></a>
						</td>
					</tr>
					@endforeach
				</tbody>
			</table>
		</div>
	</div>
</div>


    <div class="container-fluid">
       {!! $goods->appends('name',$name)->render() !!}
    </div> 
@endsection

</body>
</html>